import { Component, OnInit, Input } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ComputerService, Computer } from '../../services/computer.service';

@Component({
	selector: 'm-edit',
	templateUrl: './edit.component.html',
	styleUrls: ['./edit.component.scss'],
})
export class EditComponent implements OnInit {
	constructor(private modal: NgbActiveModal, private computerService: ComputerService) {}
	computer: Computer;
	ngOnInit() {}
	cancel() {
		this.modal.dismiss();
	}
	async save(c: Computer) {
		await this.computerService.update(c);
		this.modal.close();
	}
}
